﻿using SqlSugar.Extensions;
using System;

namespace EShop.Net.Configuration
{
    /// <summary>
    /// 获取配置文件帮助类
    /// </summary>
    public class AppSettingsConstVars
    {
        #region 数据库================================================================================
        /// <summary>
        /// 获取数据库连接字符串
        /// </summary>
        public static readonly string DbSqlConnection = AppSettingsHelper.GetContent("ConnectionStrings", "SqlConnection");
        /// <summary>
        /// 获取数据库类型
        /// </summary>
        public static readonly string DbDbType = AppSettingsHelper.GetContent("ConnectionStrings", "DbType");
        #endregion

        #region Jwt授权配置===========================================================================
        public static readonly string JwtConfigSecretKey = AppSettingsHelper.GetContent("JwtSeetings", "SecretKey");
        public static readonly string JwtConfigIssuer = AppSettingsHelper.GetContent("JwtSeetings", "Issuer");
        public static readonly string JwtConfigAudience = AppSettingsHelper.GetContent("JwtSeetings", "Audience");
        public static readonly string JwtConfigAdminExpires = AppSettingsHelper.GetContent("JwtSeetings", "AdminExpires");
        public static readonly string JwtConfigUserExpires = AppSettingsHelper.GetContent("JwtSeetings", "UserExpires");
        #endregion

        #region 跨域设置==============================================================================
        public static readonly string CorsPolicyName = AppSettingsHelper.GetContent("Cors", "PolicyName");
        public static readonly bool IsAllIPs = AppSettingsHelper.GetContent("Cors", "IsAllIPs").ObjToBool();
        public static readonly string CorsIPs = AppSettingsHelper.GetContent("Cors", "IPs");
        #endregion

        #region 微信配置==============================================================================
        public static readonly string WeCharAppId = AppSettingsHelper.GetContent("WeChar", "AppId");
        public static readonly string WeCharAppSecret = AppSettingsHelper.GetContent("WeChar", "AppSecret");
        #endregion
    }
}
